<template>
    <div id="app">
        <div class="wrapBox">
            <keep-alive>
                <router-view v-if="$route.meta.keepAlive"></router-view>
            </keep-alive>
            <router-view v-if="!$route.meta.keepAlive"></router-view>
        </div>
    </div>
</template>

<script>
export default {
    name: 'App',
    data () {
        return {
        }
    },
    created () {
        let queryArr
        let query = {}
        if (window.location.href.split('?')[1]) {
            queryArr = window.location.href.split('?')[1].split('&')
            queryArr.forEach(item => {
                query[item.split('=')[0]] = item.split('=')[1]
            })
        }
        query.userInfo && localStorage.setItem('userInfo', decodeURI(query.userInfo))
        this.getSignature()
    },
    methods: {
        getSignature () {
            let params = {
                'business': 'GetSignature',
                'data': {
                    type: 0,
                    url: window.location.href.split('#')[0]
                }
            }
            this.$axiosAjax.getConfigJson(params).then((res) => {
                if (res.data.code === 0) {
                    wx.config({
                        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                        appId: res.data.appid ? res.data.appid : 'wxf873bd7fdb2bd0be', // 必填，公众号的唯一标识
                        timestamp: res.data.timestamp, // 必填，生成签名的时间戳
                        nonceStr: res.data.noncestr, // 必填，生成签名的随机串
                        signature: res.data.signature, // 必填，签名
                        jsApiList: ['scanQRCode', 'chooseImage', 'uploadImage'] // 必填，需要使用的JS接口列表
                    })
                } else {
                }
            }).catch((res) => {
            })
        }
    }
}
</script>

<style>
#app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    height: 100%;
}
.wrapBox {
    height: 100%;
    min-height: 100%;
}
.clearfix:after {
    display: block;
    clear: both;
    content: '';
    visibility: hidden;
    height: 0;
}
.clearfix {
    zoom: 1;
}
em {
    font-style: normal;
}
body {
    height: 100%;
    width: 100%;
    overflow: auto; /* winphone8和android4+ */
    /* -webkit-overflow-scrolling: touch; /* ios5+ */
}
.workmain .weui-grids:after,
.workmain .weui-grids:before {
    border-top: 0;
}
body .vux-header {
    background-color: #2269ff;
}
body .vux-header .vux-header-title > span {
    color: #fff;
    font-size: 16px;
}
body .weui-search-bar__cancel-btn {
    color: #2269ff;
}
.select .vux-x-icon {
    fill: #2269ff;
}
body .weui-tabbar {
    position: fixed;
    z-index: 1;
    -webkit-transform: translateZ(1px);
    -moz-transform: translateZ(1px);
    -o-transform: translateZ(1px);
    transform: translateZ(1px);
}
.notice .weui-cell_access .weui-cell__ft {
    width: 26px;
}
.test .weui-cell_access .weui-cell__ft {
    width: 26px;
}
.looktest .weui-cell_access .weui-cell__ft {
    width: 100px;
}
.looktest .weui-cell__hd,
.looktest .vux-cell-bd {
    display: none;
}
.main > .tree-menu > ul > li {
    /*border-bottom:1px solid #ccc;*/
}
/*.pswp{
  display:none;
}*/
body .vux-header .vux-header-left a {
    color: #fff;
}
body .vux-header .vux-header-left .left-arrow:before {
    border-color: #fff;
}
@keyframes showaa {
    0% {
        transform: rotate(0);
    }
    50% {
        transform: rotate(20deg);
    }
    100% {
        transform: rotate(36deg);
    }
}

.weui-icon_toast.weui-loading {
    animation: showaa 1s infinite;
}
.newsafework .showlist .weui-cells:after {
    border-bottom: 0;
}
.newsafework .showlist .weui-cells {
    padding-left: 0;
    margin-top: 0;
}
.newsafework .showlist .weui-cell {
    padding-left: 0;
    font-size: 13px;
}
.newsafework .showlist {
    margin-bottom: 0;
}
</style>
